{include file="common/header" /}
<body>
<head>
{include file="common/personal_top" /}
<!--用户中心样式-->
<div class="user_style clearfix">
 <div class="user_center clearfix">
   <!--左侧样式-->
    {include file="common/center" /}
 </div>
 <!--右侧样式-->
   <div class="right_style">
 <!--消费记录样式-->
  <div class="user_address_style">
    <div class="title_style"><em></em>用户信息</div> 
      <!--用户信息样式-->
     <!--个人信息-->
     <form action="{:url('personal/save')}" method="post" enctype="multipart/form-data">
        <div class="Personal_info" id="Personal">
           <ul class="xinxi">
           <li><label>用户名：</label>  <span><input name="" type="text" value="{$user->username}"  class="text"  disabled="disabled"/></span></li>
           <li><label>真实姓名：</label>  <span><input name="real_name" type="text" value="{$user->real_name}"  class="text remove"  disabled="disabled"/></span></li>
            <li><label>地址：</label> <span class="time">{$user->address}</span>
             <div class="add_time">
                <select name="province" class="sel">
                  <option value="0">--省份--</option>
                  {volist name="province" id="pro"}
                  <option value="{$pro.id}" {if condition="$prov eq $pro.id"} selected="selected"{/if}>{$pro.name}</option>
                  {/volist}
                </select>
                <select name="city" class="sel2">
                  <option value="0">--城市--</option>
                  {volist name="city" id="city"}
                  <option value="{$city.id}" {if condition="$cty eq $city.id"} selected="selected"{/if}>{$city.name}</option>
                  {/volist}
                </select>
             </div>
            </li>
            <li><label>电子邮箱：</label>  <span><input name="email" type="text" value="{$user->email}"  class="text remove"  disabled="disabled"/></span></li>
            <li><label>邮编：</label>  <span><input name="postcode" type="text" value="{$user->postcode}"  class="text remove" disabled="disabled" /></span></li>        
            <li><label>移动电话：</label>  <span><input name="mobile" type="text" value="{$user->mobile}"  class="text remove"  disabled="disabled"/></span></li>
            <div class="bottom"><input name="" type="button" value="修改信息"  class="modify"/><input name="" type="submit" value="确认修改"  class="confirm"/></div>
           </ul>
           <ul class="Head_portrait">
            <li class="User_avatar"><img src="{$user->picture}" alt="" width="200" height="200"></li>
            <br>
            <li>
              <a href="javascript:;" class="file">修改头像
                <input type="file" name="icon" id="upload" >
              </a>
            </li>
           </ul>
        </div> 
      </form>   
   </div>
  </div>
 </div>
 </div>
 {include file="common/footer" /}
</body>
</html>
<script>
var SCOPE = {
  'city_url': "{:url('personal/getCityById')}",
  };
$('.sel').change(function(){
  $('.sel2').empty();
  pid = $(this).val();
  data = {'id':pid};
  url = SCOPE.city_url;
  $.post(url,data,function(result){
    if (result.status == 1) {
      data = result.data;
      sec_html = '';
        $(data).each(function(i){
                  sec_html += "<option value='"+this.id+"'>"+this.name+"</option>";

             });
      $('.sel2').html(sec_html);
    }else if(result.status == 0){
      $('.sel2').html('');
      return;
    }
  },'json');
});


</script>
